package com.yjha.lzmarathonsys.enmu;

public enum ApiEndpoint {
    GETUSERINFO("//wx/getUserInfo"),
    GETFINDISUSER("//perManage/isUserMange"),
    GETREALNAME("//perManage/realNameAuthentication"),
    GETFINDUSER("//perManage/getUserMange"),
    GETDATETIME("//perBooked/getAppointmentTime"),
    GETPERSONADD("//perBooked/personnelReservation"),
    GETPERSONFIND("//perBooked/getMypersonnelReservation"),
    GETCARADD("//carBooked/vehicleReservation"),
    GETCARLIST("//carBooked/findHistory"),
    GETCARDATE("//carBooked/getAppointmentTime"),
    GETUPDATNAME("//perManage/updateRealNameInformation");


    private String url;

    ApiEndpoint(String url) {
        this.url = url;
    }

    public String getUrl() {
        return url;
    }

    public static boolean isValidFrontendEndpoint(String requestUrl) {
        // 检查是否与 ApiEndpoint 中的 URL 匹配
        for (ApiEndpoint endpoint : ApiEndpoint.values()) {
            if (endpoint.getUrl().equals(requestUrl)) {
                return true;
            }
        }
        return false;
    }
}
